import { routerRedux } from 'dva/router';
import { message } from 'antd';
import { getCategoryList } from '@/services/api';
export default {
    namespace: 'categoryList',
    state: {
        data: {
            list: [],
            pagination: {},
        }
    },
    effects: {
        * getCategoryList({ payload }, { put, call }) {

            const response = yield call(getCategoryList, payload);
            let data={
                'list':response.data
            }
            console.log("get categoryList");
            console.log(response);
            yield put({
		        type: 'loadList',
		        payload: data,
		      });
        }
    },
    reducers: {
    	loadList(state,action){
    		console.log(action);
    		return {
    			...state,
    			list:action.payload
    		}
    	}
    }
}